<template>
    <Table :columns="columns" :data="value">
        <template slot-scope="{ row, index }" slot="order">
            <span>{{row.order.code}}</span>
        </template>
        <template slot-scope="{ row, index }" slot="status">
            <span v-if="row.order.status === -1">取消</span>
            <span v-if="row.order.status === 0">草稿</span>
            <span v-if="row.order.status === 1">确认</span>
            <span v-if="row.order.status === 2">异常</span>
            <span v-if="row.order.status === 3">清关中</span>
            <span v-if="row.order.status === 4">待发货</span>
            <span v-if="row.order.status === 5">已发货</span>
        </template>
    </Table>
</template>

<script>
    export default {
        name: "order",
        props: {
            value: {
                type: Array,
                default: () => []
            }
        },
        data() {
            return {
                columns: [{
                    title: '序号',
                    width: 80,
                    type: 'index'
                },  {
                    title: '订单号',
                    slot: 'order'
                },{
                    title: '数量',
                    key: 'quantity'
                },{
                    title: '单价',
                    key: 'price'
                },{
                    title: '订单状态',
                    slot: 'status'
                }, {
                    title: '操作时间',
                    key: 'created_at'
                }]
            }
        }
    }
</script>

<style scoped>

</style>